﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Joyintech.Model.inpiao365;
using Joyintech.BLL.inpiao365;

namespace Joyintech.Web.inpiao365.UserCenter
{
    public partial class MyUser_Charge_Phone : System.Web.UI.Page
    {
        protected String mobile;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                customer customer = customer_BLL.GetInstance().GetCurrentCustomer();
                if (customer == null)
                {
                    Response.Redirect("UserLogin.aspx");
                }
                else
                {
                    mobile = customer.CustomerPhone;
                }
            }

        }

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            customer customer = customer_BLL.GetInstance().GetCurrentCustomer();

            customer.CustomerPhone = txt_mobile.Text;

            customer_BLL bll = new customer_BLL();
            int result = bll.UpdateAutoCheck(customer);
            if (result > 0)
            {
                Response.Redirect("MyUser_Saveinfo.aspx");
            }
            else
            {

            }
        }
    }
}